package com.dzsw;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.config.Configurator;


public class Main {

    private static Logger logger = LogManager.getLogger(Main.class);
    public static void main(String[] args) throws Exception {
        Configurator.initialize("Main", Main.class.getClassLoader(), "classpath:log4j2.xml");
        logger.debug("Debug message");
        logger.info("Info message");
        logger.warn("Warning message");
        logger.error("Error message");
        logger.fatal("Fatal message");
        throw new Exception("Exception message");
    }
}